#include "Bonus.h"

using namespace model;

Bonus::Bonus(void) : Entity()
{	
}

Bonus::~Bonus(void)
{
}

string Bonus::getImagePath(void)
{
	return imagePath;
}

void Bonus::setImagePath(string path)
{
	this->imagePath = path;
}

void Bonus::setStartTime(double start)
{
	this->startTime = start;
}

double Bonus::getStartTime()
{
	return startTime;
}

void Bonus::applyTo(Ship* ship)
{
	if (type == Bonus::MISSILE)
	{
		ship->setMissiles(5);
	}
	else if (type == Bonus::SUPER_SHIELD)
	{
		ship->getSuperShield()->enable();
	}
	else if (type == Bonus::LASER)
	{
		ship->enableLaser();
	}
	else if (type == Bonus::NEUTRON_BOMB)
	{
		ship->enableNeutronBomb();
	}
	else if (type == Bonus::INVISIBILITY)
	{
		ship->enableInvisibility();
	}
	else if (type == Bonus::MINE)
	{
		ship->setMines(3);
	}
	else if (type == Bonus::BOMB)
	{
		ship->enableBomb();
	}
	else if (type == Bonus::GUIDED_MISSILE)
	{
		ship->enableGuidedMissil();
	}
	else if (type == Bonus::SHIELD)
	{
		ship->getShield()->enable();
		ship->setShieldEnergy(SHIELD_MAX_LIFE);
	}
	else if (type == Bonus::GRAVITATIONAL_SHIELD)
	{
		ship->enableGravitationShield();
	}
	else if (type == Bonus::GRAVITATIONAL_WEAPON)
	{
		ship->enableGravitationWeapon();
	}
}

void Bonus::setType(BonusType type)
{
	this->type = type;
}

Bonus::BonusType Bonus::getType()
{
	return type;
}

void Bonus::updatePositions(double currentTime)
{
	// no hace falta actualizar xq permanece siempre en el mismo lugar
}
